Skip to content

feat(webui): support for commit hash update (implement #6782)#6817

Open
mzwing wants to merge 5 commits intoAstrBotDevs:masterfrom
mzwing:master
Open

feat(webui): support for commit hash update (implement #6782)#6817
mzwing wants to merge 5 commits intoAstrBotDevs:masterfrom
mzwing:master

Conversation

@mzwing
Copy link
Contributor

@mzwing mzwing commented Mar 22, 2026

Implement #6782 .

Add support for dashboard WebUI to support update via specifying commit hash.

This can let users preview the unreleased fixes or features much more easily.

Modifications / 改动点

Edited files:

  • dashboard/src/layouts/full/vertical-header/VerticalHeader.vue: Add commit input frame logic.
  • dashboard/src/i18n/locales/**/core/header.json: Add needed text's i18n translation.

Functions:

  • Use the already existed commit hash update logic in the backend to support this function.

Note:

  • I'm not familiar with ru-RU, so I just translate it using Google Translate. It may be better to refine the i18n text later.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

Screenshot:

image

Log:

[01:57:23.407] [Core] [INFO] [core.core_lifecycle:297]: AstrBot 启动完成。
[01:57:23.409] [Core] [INFO] [utils.temp_dir_cleaner:127]: TempDirCleaner started. interval=600s cleanup_ratio=0.3
[2026-03-23 01:57:23 +0800] [54371] [INFO] Running on http://0.0.0.0:6185 (CTRL + C to quit)
[01:57:24.319] [Core] [INFO] [t2i.network_strategy:56]: Successfully got 2 official T2I endpoints.
[01:57:24.924] [Core] [INFO] [utils.llm_metadata:63]: Successfully fetched metadata for 2213 LLMs.
[01:58:31.791] [Core] [INFO] [core.updator:172]: 准备更新至指定版本的 AstrBot Core: e9b1dd35f9f08ed83c998bd3aea4ec5d870e116d
[01:58:34.302] [Core] [INFO] [core.updator:180]: 下载 AstrBot Core 更新文件完成,正在执行解压...
[01:58:34.450] [Core] [DBUG] [core.zip_updator:216]: 解压文件完成: temp.zip
[01:58:37.028] [Core] [DBUG] [core.zip_updator:228]: 删除临时更新文件: temp.zip 和 /Users/mzwing/repos/mzwing/AstrBot/AstrBot-e9b1dd35f9f08ed83c998bd3aea4ec5d870e116d/
[01:58:37.028] [Core] [INFO] [utils.io:277]: 准备下载指定版本的 AstrBot WebUI: https://github.com/AstrBotDevs/astrbot-release-harbour/releases/download/release-e9b1dd35f9f08ed83c998bd3aea4ec5d870e116d/dist.zip
文件大小: 7045.87 KB | 文件地址: https://github.com/AstrBotDevs/astrbot-release-harbour/releases/download/release-e9b1dd35f9f08ed83c998bd3aea4ec5d870e116d/dist.zip
下载进度: 100.00% 速度: 7379.36 KB/s
[01:58:39.042] [Core] [INFO] [routes.update:115]: 更新依赖中...
[01:58:39.123] [Core] [INFO] [utils.core_constraints:110]: 已启用核心依赖版本保护 (56 个约束)
[01:58:39.124] [Core] [INFO] [utils.pip_installer:1012]: Pip 包管理器 argv: ['pip', 'install', '-r', 'requirements.txt', '--trusted-host', 'mirrors.aliyun.com', '-i', 'https://mirrors.aliyun.com/pypi/simple/', '-c', '/var/folders/zq/7k5w0qwx5r5ff4qwfpqmb7000000gn/T/tmp_s3_kvc8_constraints.txt']
[01:58:39.373] [Core] [INFO] [utils.pip_installer:216]: Looking in indexes: https://mirrors.aliyun.com/pypi/simple/

Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Add dashboard WebUI support for updating to a specific core version by commit hash and update related UI assets and translations.

New Features:

  • Allow users to trigger a core update from the dashboard by entering an explicit commit hash in the update dialog.

Enhancements:

  • Add commit-hash input validation rules to the update dialog form.
  • Extend the Material Design Icons subset with a QR code icon for future UI use.
  • Add i18n strings for the commit-hash update flow in English, Chinese, and Russian locales.

Copilot AI review requested due to automatic review settings March 22, 2026 18:00
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 22, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to the dashboard's update mechanism, allowing users to directly specify a Git commit hash to update the application. This capability streamlines the process of testing and previewing unreleased features or bug fixes, providing greater flexibility and control over the application version. The changes primarily involve UI integration and internationalization to support this new functionality.

Highlights

  • WebUI Update via Commit Hash: Implemented a new feature allowing users to update the WebUI by specifying a Git commit hash, enabling easier preview of unreleased fixes and features.
  • User Interface Enhancements: Added a dedicated input field and an 'Install' button within the update dialog in VerticalHeader.vue for the commit hash update functionality.
  • Internationalization Support: Introduced new translation keys across English, Russian, and Simplified Chinese locale files to support the new commit hash update feature's UI text.
  • Icon Addition: Included the mdi-qrcode icon in the Material Design Icons subset used by the dashboard.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The commit hash validation logic is duplicated between commitHashRules and the button :disabled expression; consider centralizing this into a single computed (e.g., isCommitHashValid) or shared helper to avoid divergence.
  • The newly added .mdi-qrcode icon in the MDI subset appears unused in the shown changes; if it's not required by this feature, consider removing it to keep the subset minimal.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The commit hash validation logic is duplicated between `commitHashRules` and the button `:disabled` expression; consider centralizing this into a single computed (e.g., `isCommitHashValid`) or shared helper to avoid divergence.
- The newly added `.mdi-qrcode` icon in the MDI subset appears unused in the shown changes; if it's not required by this feature, consider removing it to keep the subset minimal.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added area:webui The bug / feature is about webui(dashboard) of astrbot. feature:updater The bug / feature is about astrbot updater system labels Mar 22, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature allowing users to update the application by specifying a commit hash, which is great for testing unreleased changes. The implementation is well-contained, adding a new UI component to the update dialog and correctly leveraging existing backend functionality. I've included a couple of suggestions to refactor a small piece of duplicated validation logic in the Vue component to enhance maintainability. Otherwise, the changes look good.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a WebUI option to update AstrBot by specifying a Git commit hash (leveraging the existing backend update endpoint), plus the necessary i18n strings.

Changes:

  • Add a commit-hash input + validation + “install” button to the update dialog UI.
  • Add i18n strings for the new commit-hash section (zh-CN/en-US/ru-RU).
  • Regenerate/update the MDI subset (CSS + bundled font files), including adding mdi-qrcode.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dashboard/src/layouts/full/vertical-header/VerticalHeader.vue Adds commit-hash input UI and hooks it into the existing /api/update/do update flow
dashboard/src/i18n/locales/zh-CN/core/header.json Adds zh-CN strings for commit-hash update section
dashboard/src/i18n/locales/en-US/core/header.json Adds en-US strings for commit-hash update section
dashboard/src/i18n/locales/ru-RU/core/header.json Adds ru-RU strings for commit-hash update section
dashboard/src/assets/mdi-subset/materialdesignicons-subset.css Updates auto-generated icon subset CSS (adds mdi-qrcode, updates icon count comment)
dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff2 Updated icon subset font binary
dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff Updated icon subset font binary

@mzwing
Copy link
Contributor Author

mzwing commented Mar 22, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a useful feature to update the application via a specific commit hash from the WebUI. The implementation is straightforward, reusing existing logic. I've found a few areas for improvement regarding code style and maintainability. Specifically, I've suggested removing inline styles in favor of CSS classes, adding missing newlines at the end of JSON files, and separating an unrelated icon change into its own pull request to maintain focus. These changes will improve code quality and consistency.

@mzwing
Copy link
Contributor Author

mzwing commented Mar 22, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature allowing users to update the application to a specific version using a commit hash directly from the WebUI. The changes are well-implemented, including the addition of the necessary UI components, input validation, and internationalization support. The code reuses existing update logic effectively. I have one suggestion to improve the accessibility and UI consistency of the new input field.

@mzwing
Copy link
Contributor Author

mzwing commented Mar 22, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature allowing users to update the application to a specific version using a commit hash, which is great for testing unreleased changes. The implementation is straightforward, adding a new input section to the existing update dialog and reusing the backend logic.

My main feedback is a critical issue regarding the internationalization (i18n) keys used for the new UI elements. The keys have an incorrect path, which will prevent the text from being displayed correctly. I've left specific comments with suggestions to fix this.

Once the i18n keys are corrected, this change looks good to go.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. feature:updater The bug / feature is about astrbot updater system size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants